package com.md.api;

import com.md.model.page.PageResponse;
import com.md.model.system.CommonResult;
import com.md.request.LinkApiRequest;
import com.md.request.LinkModuleRequest;
import com.md.request.QueryRolePageRequest;
import com.md.request.QueryRoleRequest;
import com.md.request.QueryUsersApiRequest;
import com.md.request.QueryUsersAppInfoRequest;
import com.md.request.QueryUsersModuleRequest;
import com.md.request.RoleRequest;
import com.md.request.UpdateStatusRequest;
import com.md.response.RoleResponse;
import com.md.response.UsersApiResponse;
import com.md.response.UsersAppInfoResponse;
import com.md.response.UsersModuleResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author 刘骄阳
 * 2024-12-15 1:24
 */
@Api(tags = "角色")
public interface RoleApi {
  String PATH_PREFIX = "/api/role";

  @PostMapping(PATH_PREFIX + "/create")
  @ApiOperation("注册角色信息")
  CommonResult<RoleResponse> create(@RequestBody RoleRequest request);

  @PostMapping(PATH_PREFIX + "/update")
  @ApiOperation("更新角色信息")
  CommonResult<RoleResponse> update(@RequestBody RoleRequest request);

  @PostMapping(PATH_PREFIX + "/detail")
  @ApiOperation("查询角色详情")
  CommonResult<RoleResponse> detail(@RequestBody QueryRoleRequest request);

  @PostMapping(PATH_PREFIX + "/list")
  @ApiOperation("查询角色列表")
  CommonResult<PageResponse<RoleResponse>> list(@RequestBody QueryRolePageRequest request);

  @PostMapping(PATH_PREFIX + "/update-status")
  @ApiOperation("更新角色状态")
  CommonResult<Void> updateStatus(@RequestBody UpdateStatusRequest request);

  @PostMapping(PATH_PREFIX + "/link-api")
  @ApiOperation("角色绑定api")
  CommonResult<Void> linkApi(@RequestBody LinkApiRequest request);

  @PostMapping(PATH_PREFIX + "/link-module")
  @ApiOperation("角色绑定模块")
  CommonResult<Void> linkModule(@RequestBody LinkModuleRequest request);

  @PostMapping(PATH_PREFIX + "/module/list")
  @ApiOperation("查询模块列表")
  CommonResult<PageResponse<UsersModuleResponse>> moduleList(@RequestBody QueryUsersModuleRequest request);

  @PostMapping(PATH_PREFIX + "/app-info/list")
  @ApiOperation("查询应用列表")
  CommonResult<PageResponse<UsersAppInfoResponse>> appInfoList(@RequestBody QueryUsersAppInfoRequest request);

  @PostMapping(PATH_PREFIX + "/api/list")
  @ApiOperation("查询api列表")
  CommonResult<PageResponse<UsersApiResponse>> apiList(@RequestBody QueryUsersApiRequest request);
}
